﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IIrcConnectionCodeContracts.cs" company="LeetSoftwerx">
//   Copyright ©2012 LeetSoftwerx
// </copyright>
// <summary>
//   TODO: Update summary.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Irclib
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.Contracts;
    using System.Text;

    /// <summary>
    /// Code contracts for <see cref="IIrcConnection"/>
    /// </summary>
// ReSharper disable InconsistentNaming
    public class IIrcConnectionCodeContracts : IIrcConnection
// ReSharper restore InconsistentNaming
    {
        #region Public Properties

        /// <summary>
        ///   Gets a value indicating whether or not the connection is active
        /// </summary>
        public bool Connected
        {
            get
            {
                return default(bool);
            }
        }

        /// <summary>
        ///   Gets the current hostname of the user from the perspective of the server
        /// </summary>
        public string HostName
        {
            get
            {
                Contract.Ensures(!string.IsNullOrWhiteSpace(Contract.Result<string>()));
                return default(string);
            }
        }

        /// <summary>
        ///   Gets or sets the users Nickname
        /// </summary>
        public string Nickname
        {
            get
            {
                Contract.Ensures(!string.IsNullOrWhiteSpace(Contract.Result<string>()));
                return default(string);
            }

            set
            {
                Contract.Requires(!string.IsNullOrWhiteSpace(value));
            }
        }

        /// <summary>
        ///   Gets the URI for the server
        /// </summary>
        public Uri Server
        {
            get
            {
                Contract.Ensures(Contract.Result<Uri>() != null);
                return default(Uri);
            }
        }

        /// <summary>
        ///   Gets the encoding of the server
        /// </summary>
        public Encoding ServerEncoding
        {
            get
            {
                Contract.Ensures(Contract.Result<Encoding>() != null);
                return default(Encoding);
            }
        }

        /// <summary>
        ///   Gets the name of the server
        /// </summary>
        public string ServerName
        {
            get
            {
                Contract.Ensures(!string.IsNullOrWhiteSpace(Contract.Result<string>()));
                return default(string);
            }
        }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        /// List channels and their topics.
        /// </summary>
        /// <param name="channels">
        /// A list of specific channels to get the status of, or null to get all 
        /// </param>
        /// <returns>
        /// An <see cref="IEnumerable{T}"/> of <see cref="ChannelInfo"/> with the channel information 
        /// </returns>
        public IEnumerable<ChannelInfo> ChannelList(IEnumerable<string> channels)
        {
            Contract.Requires(
                channels != null && Contract.ForAll(channels, channel => !string.IsNullOrWhiteSpace(channel)));
            Contract.Ensures(Contract.Result<IEnumerable<ChannelInfo>>() != null);
            return default(IEnumerable<ChannelInfo>);
        }

        /// <summary>
        /// Join an IRC channel
        /// </summary>
        /// <param name="channelName">
        /// The name of the channel to join 
        /// </param>
        /// <returns>
        /// The <see cref="IrcChannel"/> Object that encapsulates the functionality necessary to interact with that channel 
        /// </returns>
        public IrcChannel Join(string channelName)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Sends the ping command to the specified server
        /// </summary>
        public void Ping()
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Sends a line to the server
        /// </summary>
        /// <param name="toWrite">
        /// The message to send to the server, should not exceed 510 characters total 
        /// </param>
        /// <returns>
        /// The server response 
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// Thrown if the message is null
        /// </exception>
        /// <exception cref="ArgumentOutOfRangeException">
        /// The length of toWrite exceeds 510 characters
        /// </exception>
        public string Send(string toWrite)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// Begins pinging the server every 15 sec, required to prevent timeout
        /// </summary>
        /// <param name="serverName">
        /// The server Name. 
        /// </param>
        public void StartPing(string serverName)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}